<template>
  <div :class="{ cardactive : item.active }"
    @click="selectedQs"
    :style="{ background: picList.includes(item.feature) ?
              (item.active ? 'url('+ require('../../assets/img/strategybycourty/active/' + item.feature + '.png') +')'
                          : 'url('+ require('../../assets/img/strategybycourty/' + item.feature + '.png') +')') : 
               item.active ? 'linear-gradient(0deg,#4f6aff 0%,#7792ff 100%)'
                          : 'white', justifyContent: picList.includes(item.feature) ? 'flex-end' : 'center' }"
    class="card">
    <div style="transform: translateY(-2px)">
      <a style="display: block;" :class="{ aActive: item.active }">{{item.size_name}}</a>
      <a style="display: block;" :class="{ aActive: item.active }">{{item.feature}}</a>
    </div>
    <span style="letter-spacing: 1px;position: absolute;right: 8px;top: 4px;color: rgb(254, 122, 74);" :class="{ spanActive: item.active }">
    {{Math.floor(item.yr * 100)}}<sub style="display: inline-block;transform: translateY(-2px);font-size: 0.7em">%</sub>
    </span>
  </div>
</template>

<script>
export default {
  name: 'qstragery-card',
  props: {
    item: {
      type: Object,
      default: {}
    }
  },
  watch: {
    active: function (val) {

    }
  },
  methods: {
    selectedQs () {
      this.$emit('selected')
    }
  },
  data () {
    return {
      globalRem: 1,
      picList: ['低风险', '低估值', '分析师', '高效率', '高盈利', '均衡', '快速成长', '逆天择时', '趋势看涨', '小企业']
    }
  },
  created () {

  }
}
</script>

<style lang="less" scoped>
.card {
  img {
    height: 100%;
    width: 100%;
  }
  display: inline-flex;
  justify-content: space-between;
  flex-direction: column;
  width: 6.7rem;
  height: 8.8rem;
  align-items: space-between;
  box-shadow: 0 1px 3px 0 rgba(176,187,238,0.47), 0 -1px 3px 0 rgba(176,187,238,0.51);
  color: #666;
  text-align: center;
  margin: 0.5rem;
  padding: 0.3rem 0.4rem 0rem 0.4rem;
  overflow: hidden;
  justify-content: flex-end;
  .title {
    
  }
  border-radius: 10px;
  background-size: 100% 100% !important;
  position: relative;
  @media screen and (max-width:375px) and (min-width:321px) {
    width: 7.8rem;
    height: 10.3rem;
  }
  @media screen and (min-width: 376px){
    width: 8.6rem;
    height: 11.4rem;
  }
  a {
    font-size: 1.4rem;
    text-align: center;
    @media screen and (max-width:375px) and (min-width:321px) {
      font-size: 1.5rem
    }
    @media screen and (min-width: 376px){
      font-size: 1.6rem
    }
  }
  a:nth-child(1) {
    font-size: 1.1rem;
    text-align: center;
    transform: translate3d(0, 2px, 0);
    @media screen and (max-width:375px) and (min-width:321px) {
      font-size: 1.2rem
    }
    @media screen and (min-width: 376px){
      font-size: 1.3rem
    }
  }
  span {
    font-size: 1.3rem;
    @media screen and (max-width:375px) and (min-width:321px) {
      font-size: 1.4rem;
    }
    @media screen and (min-width: 376px){
      font-size: 1.5rem;
    }
    sub {
      font-size: 0.8rem;
      display: block;
      @media screen and (max-width:375px) and (min-width:321px) {
        font-size: 0.9rem;
      }
      @media screen and (min-width: 376px){
        font-size: 1rem;
      }
    }
  }
  i {
    position: absolute;
    display: block;
    width: 100%;
    color: #6379F8;
    font-size: 3.1rem;
  }
  .lineActive {
    color: white;
    margin-top: -0.1em;
    margin-left: -0.1em;
  }
  .spanActive {
    color: white !important;
    font-size: 1.4rem;
    @media screen and (max-width: 320px) {

    }
    @media screen and (max-width:375px) and (min-width:321px) {
      font-size: 1.5rem;
    }
    @media screen and (min-width: 376px){
      font-size: 1.6rem;
    }
  }
  .aActive {
    font-size: 1.3rem;
    @media screen and (max-width:375px) and (min-width:321px) {
      font-size: 1.4rem;
    }
    @media screen and (min-width: 376px){
      font-size: 1.5rem;
    }
  }
  .aActive:nth-child(2) {
    font-size: 1.5rem;
    @media screen and (max-width:375px) and (min-width:321px) {
      font-size: 1.6rem;
    }
    @media screen and (min-width: 376px){
      font-size: 1.7rem;
    }
  }
}
.cardactive {
  background-size: 100% 100%;
  color: white !important;
  width: 6.7rem;
  height: 9.1rem;
  box-shadow: 0 7px 18px 0 rgba(101,128,255,0.63);
  margin: 0.1rem 0.5rem;
  padding: 0.7rem 0.8rem 0.2rem 0.8rem;
}
  @media screen and (max-width:375px) and (min-width:321px) {
    .cardactive {
      height: 10.7rem;
      width: 7.8rem;
    }
  }
  @media screen and (min-width: 376px){
    .cardactive {
      width: 8.6rem;
      height: 11.7rem;
    }
  }


  @media screen and (max-width: 320px) {
    .card i {
      font-size: 3.1rem;
      transform: translate3d(-0.1em, 31px, 0);
    }
    .lineActive {
      font-size: 3.5rem !important;
    }
  }
  @media screen and (max-width:375px) and (min-width:321px) {
    .card i {
      font-size: 3.6rem;
      transform: translate3d(-0.1em, 33px, 0);
    }
    .lineActive {
      font-size: 4rem !important;
    }

  }
  @media screen and (min-width: 376px){
    .card i {
      font-size: 4rem;
      transform: translate3d(-0.1em, 38px, 0);
    }
    .lineActive {
      font-size: 4.5rem !important;
    }
  }

  @media screen and (max-width: 320px) {


  }
  @media screen and (max-width:375px) and (min-width:321px) {


  }
  @media screen and (min-width: 376px){


  }
</style>
